import { loadEnv } from 'vite';
import uni from '@dcloudio/vite-plugin-uni';
import path from 'path';
import uniReadPagesV3Plugin from './shop/router/utils/uni-read-pages-v3';
import mpliveMainfestPlugin from './shop/libs/mplive-manifest-plugin';

export default (command, mode) => {
	const env = loadEnv(mode, __dirname, '');
	return {
		plugins: [
			uni(),
			uniReadPagesV3Plugin({
				includes: ['path', 'aliasPath', 'name', 'meta'],
				pagesJsonDir: path.resolve(__dirname, './pages.json'),
			}),
		],
	};
};
